// components/dyna_icon_like/dyna_icon_like.js
var animation_like = require("../../animations/animation_like.js")

Component({
    /**
     * 组件的属性列表
     */
    properties: {
        liked: {
            type: Boolean,
            value: true,
            observer: function (newVal,oldVal,changedPath) {
                let that = this
                if (newVal && !oldVal) {
                    var p = 0
                    var animation_like_control = setInterval(() => {
                        p++
                        if (p == animation_like.rotation.length)
                            clearInterval(animation_like_control)

                        that.setData({
                            rotate_liked: animation_like.rotation[p],
                            scale_liked: animation_like.scale[p]
                        })

                    }, 50)
                }
            }
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        rotate_liked: 0, //wallThumbs旋转
        scale_liked: 1.0, //wallThumbs缩放
    },

    /**
     * 组件的方法列表
     */
    methods: {

    }
})
